import React from 'react'
import ReactDom from 'react-dom'
import {createStore, applyMiddleware,compose} from 'redux'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import {
 BrowserRouter,
 Route
} from 'react-router-dom'

import './index.css'
import reducers from './reducer'
import './config'
import Login from './container/login/login'
import Register from './container/register/register'
import AuthRoute from './component/authroute/authroute';

const store = createStore(reducers,compose(
		applyMiddleware(thunk),
		window.devToolsExtension?window.devToolsExtension():f=>f
	))

const Boss = ()=>{

	return <h2>boss</h2>
}


ReactDom.render(
	(<Provider store={store}>
		<BrowserRouter>
			<div>
			  <Route path='/boss' component={Boss}></Route>
			  <AuthRoute></AuthRoute>	
			  <Route path='/login' component={Login}></Route>
		 	  <Route path='/register' component={Register}></Route>
			</div>
		</BrowserRouter>
	</Provider>),
	document.getElementById('root')
)

